package io.itit.ecp.admin.server.service;

import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
import io.itit.ecp.admin.common.enums.IMeterDeviceEnums;
import io.itit.ecp.admin.server.entity.MeterDeviceEntity;
import io.itit.ecp.admin.server.entity.extend.MeterDeviceExtEntity;

import java.util.List;

/**
 * <p>
 *
 * @Author：Roy
 * @Description：计量设备管理服务类
 * @Date：Create by 2023-11-30 18:51:39
 */

public interface IMeterDeviceService extends JoinIService<MeterDeviceEntity> {


    List<MeterDeviceExtEntity> countMeterType();

    /**
     * 删除计量设备
     *
     * @param ids
     * @return
     */
    boolean deleteMeterDevice(List<String> ids);

    boolean saveMeterDeviceBatch(List<MeterDeviceEntity> entities);

    int countOnline(String sceneProjectId, String sceneEdificeId, String sceneFloorId);

    int countOffline(String sceneProjectId, String sceneEdificeId, String sceneFloorId);

    default MeterDeviceEntity findByDeviceCode(String deviceCode) {
        return this.findByDeviceCode(deviceCode, IMeterDeviceEnums.DelFlag.delFlag1.delFlag);
    }

    MeterDeviceEntity findByDeviceCode(String deviceCode, String delFlag);

}
